package com.qunar.qcf.socket;

import java.net.InetSocketAddress;

import com.qunar.qcf.core.service.IoAcceptor;
import com.qunar.qcf.core.session.IoSessionRecycler;

/**
 * {@link IoAcceptor} for datagram transport (UDP/IP).
 *
 */
public interface DatagramAcceptor extends IoAcceptor {
    InetSocketAddress getLocalAddress();
    InetSocketAddress getDefaultLocalAddress();
    void setDefaultLocalAddress(InetSocketAddress localAddress);

    /**
     * Returns the {@link IoSessionRecycler} for this service.
     */
    IoSessionRecycler getSessionRecycler();

    /**
     * Sets the {@link IoSessionRecycler} for this service.
     *
     * @param sessionRecycler <tt>null</tt> to use the default recycler
     */
    void setSessionRecycler(IoSessionRecycler sessionRecycler);
}
